<%--
   zTree
   Copyright (c) 2013 ISPERP
   Version : 1.0.0
 --%>
<%@ tag language="java" pageEncoding="UTF-8"
	trimDirectiveWhitespaces="true"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>


<%@ attribute name="autoParam" required="false" type="java.lang.String"
	description="异步加载时需要自动提交父节点属性的参数。[setting.async.enable = true 时生效]。默认值：[ ]"%>

<%@ attribute name="contentType" required="false"
	type="java.lang.String"
	description="Ajax 提交参数的数据类型。[setting.async.enable = true 时生效]。 默认值：application/x-www-form-urlencoded"%>

<%@ attribute name="dataFilter" required="false" type="java.lang.String"
	description="用于对 Ajax 返回数据进行预处理的函数。[setting.async.enable = true 时生效]。默认值：null"%>

<%@ attribute name="dataType" required="false" type="java.lang.String"
	description="Ajax 获取的数据类型。[setting.async.enable = true 时生效]。默认值：text"%>

<%@ attribute name="enable" required="false" type="java.lang.Boolean"
	description="设置 zTree 是否开启异步加载模式。默认值：false"%>

<%@ attribute name="otherParam" required="false" type="java.lang.String"
	description="Ajax 请求提交的静态参数键值对。[setting.async.enable = true 时生效]。默认值：[ ]"%>

<%@ attribute name="type" required="false" type="java.lang.String"
	description="Ajax 的 http 请求模式。[setting.async.enable = true 时生效]。默认值：post"%>

<%@ attribute name="url" required="false" type="java.lang.String"
	description="Ajax 获取数据的 URL 地址。[setting.async.enable = true 时生效]。默认值：空"%>

<c:set var="async" scope="request" value="{'async':'true'" />

<c:if test="${enable eq true}">
	<c:set var="async" value="${async },'enable':true" scope="request" />
</c:if>

<c:if test="${not empty autoParam}">
	<c:set var="async" value="${async },'autoParam':[${autoParam }]"
		scope="request" />
</c:if>

<c:if test="${not empty contentType}">
	<c:set var="async" value="${async },'contentType':'${contentType }'"
		scope="request" />
</c:if>

<c:if test="${not empty dataFilter}">
	<c:set var="async" value="${async },'dataFilter':'${dataFilter }'"
		scope="request" />
</c:if>

<c:if test="${not empty dataType}">
	<c:set var="async" value="${async },'dataType':'${dataType }'"
		scope="request" />
</c:if>

<c:if test="${not empty otherParam}">
	<c:set var="async" value="${async },'otherParam': ${otherParam }"
		scope="request" />
</c:if>

<c:if test="${not empty type}">
	<c:set var="async" value="${async },'type':'${type }'" scope="request" />
</c:if>

<c:if test="${not empty url}">
	<c:set var="async" value="${async },'url':encodeURI('${url }')" scope="request" />
</c:if>

<c:set var="async" value="${async }}" scope="request" />